using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace QLKS
{
    public partial class frmMain : Form
    {
        private DTO.CTAIKHOAN _taiKhoan;

        internal DTO.CTAIKHOAN TaiKhoan
        {
            get { return _taiKhoan; }
            set { _taiKhoan = value; }
        }
        private DTO.CNHANVIEN _userOnline;

        internal DTO.CNHANVIEN UserOnline
        {
            get { return _userOnline; }
            set { _userOnline = value; }
        }

        public frmMain()
        {
            InitializeComponent();
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            MChucNang.Visible = true;
            lblTen.Text = this.UserOnline.HoTen;
            lblMaNV.Text = this.UserOnline.MaNhanVien.ToString();
            lblHienthiNgay.Text = DateTime.Now.Day.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + DateTime.Now.Year.ToString();
            Thoigian.Start();
        }

        private void MbtnXoaKH_Click(object sender, EventArgs e)
        {
            Thoigian.Stop();
            frmNVXoaKH frm = new frmNVXoaKH();
            frm.ShowDialog();
        }

        private void MbtnSuaaKH_Click(object sender, EventArgs e)
        {
            Thoigian.Stop();
            frmNVSuaKH frm = new frmNVSuaKH();
            frm.ShowDialog();
        }

        private void MbtnSearch_Click(object sender, EventArgs e)
        {
            Thoigian.Stop();
            NVfrmTimKiem frm = new NVfrmTimKiem();
            frm.ShowDialog();
        }

        private void buttonItem3_Click(object sender, EventArgs e)
        {
            Thoigian.Stop();
            frmNVLapPhieuThue frm = new frmNVLapPhieuThue();
            frm.ShowDialog();
        }

        private void btnThoat_Click(object sender, EventArgs e)
        {
            Thoigian.Stop();
            this.Close();
        }

        private void MbtnLapHoaDon_Click(object sender, EventArgs e)
        {
            Thoigian.Stop();
            frmNVLapHoaDon frm = new frmNVLapHoaDon();
            frm.ShowDialog();
        }

        private void Thoigian_Tick(object sender, EventArgs e)
        {
            lblGioHeThong.Text = DateTime.Now.Hour.ToString() + ":" + DateTime.Now.Minute.ToString() + ":" + DateTime.Now.Second.ToString();
        }

        private void buttonItem1_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void MbtnThoat_Click(object sender, EventArgs e)
        {
            frDoiMatKhau doimk = new frDoiMatKhau();
            doimk.TK = this.TaiKhoan;
            doimk.ShowDialog();
        }

    }
}